package com.yuandian.customer.perception.controller;

import com.yuandian.api.customer_perception.po.DayReportParams;
import com.yuandian.api.customer_perception.po.OperatorAnalysisParams;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.customer.perception.service.IOperatorAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 说明：营业员分析controller
 * @Author yanjun
 * @Date 2021/3/23 13:51
 */
@RestController
@RequestMapping("/analysis/operator")
public class OperatorAnalysisController {

    @Autowired
    private IOperatorAnalysisService operatorAnalysisService;

    /**
     * 查询营业员排名
     * @param params 营业员分析请求参数
     * @return 通用返回对象
     */
    @PostMapping("/queryOperatorRank")
    public R queryOperatorRank(@RequestBody OperatorAnalysisParams params) {
        return operatorAnalysisService.queryOperatorRank(params);
    }

    /**
     * 查询营业员各业务情况
     * @param params 营业员分析请求参数
     * @return 通用返回对象
     */
    @PostMapping("/queryOperatorBusiSituation")
    public R queryOperatorBusiSituation(@RequestBody OperatorAnalysisParams params) {
        return operatorAnalysisService.queryOperatorBusiSituation(params);
    }

    /**
     * 查询营业员统计列表
     * @param params 营业员分析请求参数
     * @return 通用返回对象
     */
    @PostMapping("/queryOperatorStatisticsList")
    public R queryOperatorStatisticsList(@RequestBody OperatorAnalysisParams params) {
        return operatorAnalysisService.queryOperatorStatisticsList(params);
    }

    /**
     * 查询营业员排序列表
     * @param params 营业员分析请求参数
     * @return 通用返回对象
     */
    @PostMapping("/queryOperatorRankList")
    public R queryOperatorRankList(@RequestBody OperatorAnalysisParams params) {
        return operatorAnalysisService.queryOperatorRankList(params);
    }

    /**
     * 查询运维日报操作员统计topN
     * @param params 运维日报请求参数
     * @return 通用返回对象
     */
    @PostMapping("/queryReportOperatorStatisticsTopN")
    public R queryReportOperatorStatisticsTopN(@RequestBody DayReportParams params) {
        return operatorAnalysisService.queryReportOperatorStatisticsTopN(params);
    }

    /**
     * 查询运维日报操作员统计量比例
     * @param params 运维日报请求参数
     * @return 通用返回对象
     */
    @PostMapping("/queryReportOperatorProportion")
    public R queryReportOperatorProportion(@RequestBody DayReportParams params) {
        return operatorAnalysisService.queryReportOperatorProportion(params);
    }
}
